// 基础类型 number、string、boolean、undefined、null、symbol、void
const number: number = 1
const teacherName: string = "1"
const nullType: null = null

//对象类型 {} Class function []
//接口
interface Person {
  name: string
  age: number
}

//类
class Teacher implements Person {
  ii: string = "123"
  name = "teacher"
  age = 12
}

const teacher: Person = {
  name: "xys",
  age: 12,
}

//对象
const position: { x: number; y: number } = { x: 12, y: 23 }
//数组
const numbers: number[] = [1, 3, 5]
//类
const dell: Teacher = new Teacher()
// 函数           函数参数类型    函数返回值类型
const getAge: (person: Person) => number = (aa) => {
  console.log(aa.age)
  return aa.age
}

getAge(dell)

// 联合类型

let nb: string | number = "avvf"
nb = 34
